/*
 * @Description: 128*64点阵的OLED显示屏驱动文件
 * @Author: diyhome
 * @Gitee: https://gitee.com/jingjiangxueyuan_hmqs
 * @Date: 2019-12-04 16:08:55
 * @LastEditors: diyhome
 * @LastEditTime: 2019-12-04 16:55:23
 */
#ifndef __OLED_IIC_H
#define __OLED_IIC_H
#define __i2c_H

#ifdef __cplusplus
 extern "C" {
#endif

// Includes
#include "main.h"
#include "i2c.h"

//#define IIC_NAMES &hi2c1
#define OLED_Address 0x78 //通过调整0R电阻-> 0x78 && 0x7A 默认0x78

/**
 * @description: 屏幕初始化
 */
#ifndef IIC_NAMES
void OLED_Init(I2C_HandleTypeDef *device_Id);
#else
void OLED_Init(void);
#endif

/**
 * @description: 设置起点坐标
 * @param {type} x,y
 */
void OLED_SetPos(unsigned char x, unsigned char y);
/**
 * @description: 全屏填充
 * @param {type} fill_data
 */
void OLED_Fill(unsigned char fill_data);
/**
 * @description: 清屏
 */
void OLED_CLS(void);
/**
 * @description: 唤醒
 */
void OLED_ON(void);
/**
 * @description: 睡眠
 */
void OLED_OFF(void);
/**
 * @description: 显示字符串(字体大小有6*8 or 8*16)
 * @param {type} x,y,ch[],字符串尺寸
 */
void OLED_ShowStr(unsigned char x, unsigned char y, unsigned char ch[], unsigned char TextSize);
/**
 * @description: 显示中文:先取模放入codetab.h
 */
void OLED_ShowCN(unsigned char x, unsigned char y, unsigned char N);

void OLED_DrawBMP(unsigned char x0, unsigned char y0, unsigned char x1, unsigned char y1, unsigned char BMP[]);



#ifdef __cplusplus
}

#endif
#endif
